<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QTimeLine Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QTimeLine Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QTimeLine class provides a timeline for controlling
animations. <a href="#details">More...</a></p>

<p>Inherits <a href="qobject.html">QObject</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qtimeline.html#CurveShape-enum">CurveShape</a></b> { EaseInCurve, EaseOutCurve, EaseInOutCurve, LinearCurve, SineCurve, CosineCurve }</li><li><div class="fn" />enum <b><a href="qtimeline.html#Direction-enum">Direction</a></b> { Forward, Backward }</li><li><div class="fn" />enum <b><a href="qtimeline.html#State-enum">State</a></b> { NotRunning, Paused, Running }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtimeline.html#QTimeLine">__init__</a></b> (<i>self</i>, int&#160;<i>duration</i>&#160;=&#160;1000, QObject&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />int <b><a href="qtimeline.html#currentFrame">currentFrame</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtimeline.html#currentTime">currentTime</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtimeline.html#currentValue">currentValue</a></b> (<i>self</i>)</li><li><div class="fn" />CurveShape <b><a href="qtimeline.html#curveShape">curveShape</a></b> (<i>self</i>)</li><li><div class="fn" />Direction <b><a href="qtimeline.html#direction">direction</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtimeline.html#duration">duration</a></b> (<i>self</i>)</li><li><div class="fn" />QEasingCurve <b><a href="qtimeline.html#easingCurve">easingCurve</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtimeline.html#endFrame">endFrame</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtimeline.html#frameForTime">frameForTime</a></b> (<i>self</i>, int&#160;<i>msec</i>)</li><li><div class="fn" />int <b><a href="qtimeline.html#loopCount">loopCount</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#resume">resume</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#setCurrentTime">setCurrentTime</a></b> (<i>self</i>, int&#160;<i>msec</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#setCurveShape">setCurveShape</a></b> (<i>self</i>, CurveShape&#160;<i>shape</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#setDirection">setDirection</a></b> (<i>self</i>, Direction&#160;<i>direction</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#setDuration">setDuration</a></b> (<i>self</i>, int&#160;<i>duration</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#setEasingCurve">setEasingCurve</a></b> (<i>self</i>, QEasingCurve&#160;<i>curve</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#setEndFrame">setEndFrame</a></b> (<i>self</i>, int&#160;<i>frame</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#setFrameRange">setFrameRange</a></b> (<i>self</i>, int&#160;<i>startFrame</i>, int&#160;<i>endFrame</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#setLoopCount">setLoopCount</a></b> (<i>self</i>, int&#160;<i>count</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#setPaused">setPaused</a></b> (<i>self</i>, bool&#160;<i>paused</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#setStartFrame">setStartFrame</a></b> (<i>self</i>, int&#160;<i>frame</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#setUpdateInterval">setUpdateInterval</a></b> (<i>self</i>, int&#160;<i>interval</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#start">start</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtimeline.html#startFrame">startFrame</a></b> (<i>self</i>)</li><li><div class="fn" />State <b><a href="qtimeline.html#state">state</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#stop">stop</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#timerEvent">timerEvent</a></b> (<i>self</i>, QTimerEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qtimeline.html#toggleDirection">toggleDirection</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtimeline.html#updateInterval">updateInterval</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtimeline.html#valueForTime">valueForTime</a></b> (<i>self</i>, int&#160;<i>msec</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qtimeline.html#finished">finished</a></b> ()</li><li><div class="fn" />void <b><a href="qtimeline.html#frameChanged">frameChanged</a></b> (int)</li><li><div class="fn" />void <b><a href="qtimeline.html#stateChanged">stateChanged</a></b> (QTimeLine::State)</li><li><div class="fn" />void <b><a href="qtimeline.html#valueChanged">valueChanged</a></b> (qreal)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTimeLine class provides a timeline for controlling
animations.</p>
<p>It's most commonly used to animate a GUI control by calling a
slot periodically. You can construct a timeline by passing its
duration in milliseconds to QTimeLine's constructor. The timeline's
duration describes for how long the animation will run. Then you
set a suitable frame range by calling <a href="qtimeline.html#setFrameRange">setFrameRange</a>(). Finally connect
the <a href="qtimeline.html#frameChanged">frameChanged</a>() signal
to a suitable slot in the widget you wish to animate (e.g.,
setValue() in <a href="qprogressbar.html">QProgressBar</a>). When
you proceed to calling <a href="qtimeline.html#start">start</a>(),
QTimeLine will enter Running state, and start emitting <a href="qtimeline.html#frameChanged">frameChanged</a>() at regular
intervals, causing your widget's connected property's value to grow
from the lower end to the upper and of your frame range, at a
steady rate. You can specify the update interval by calling
<a href="qtimeline.html#updateInterval-prop">setUpdateInterval</a>().
When done, QTimeLine enters <a href="qtimeline.html#State-enum">NotRunning</a> state, and emits
<a href="qtimeline.html#finished">finished</a>().</p>
<p>Example:</p>
<pre class="cpp">
 <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 progressBar <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qprogressbar.html">QProgressBar</a></span>(<span class="keyword">this</span>);
 progressBar<span class="operator">-</span><span class="operator">&gt;</span>setRange(<span class="number">0</span><span class="operator">,</span> <span class="number">100</span>);

 <span class="comment">// Construct a 1-second timeline with a frame range of 0 - 100</span>
 <span class="type">QTimeLine</span> <span class="operator">*</span>timeLine <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QTimeLine</span>(<span class="number">1000</span><span class="operator">,</span> <span class="keyword">this</span>);
 timeLine<span class="operator">-</span><span class="operator">&gt;</span><a href="qtimeline.html#setFrameRange">setFrameRange</a>(<span class="number">0</span><span class="operator">,</span> <span class="number">100</span>);
 <a href="qobject.html#connect">connect</a>(timeLine<span class="operator">,</span> SIGNAL(frameChanged(<span class="type">int</span>))<span class="operator">,</span> progressBar<span class="operator">,</span> SLOT(setValue(<span class="type">int</span>)));

 <span class="comment">// Clicking the push button will start the progress bar animation</span>
 pushButton <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html">QPushButton</a></span>(tr(<span class="string">"Start animation"</span>)<span class="operator">,</span> <span class="keyword">this</span>);
 <a href="qobject.html#connect">connect</a>(pushButton<span class="operator">,</span> SIGNAL(clicked())<span class="operator">,</span> timeLine<span class="operator">,</span> SLOT(start()));
 <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
</pre>
<p>You can also use QTimeLine with the <a href="graphicsview.html#graphics-view">Graphics View framework</a> for
animations. The <a href="qgraphicsitemanimation.html">QGraphicsItemAnimation</a> class
implements animation of <a href="qgraphicsitem.html">QGraphicsItems</a> with a timeline.</p>
<p>By default the timeline runs once, from the beginning and
towards the end, upon which you must call <a href="qtimeline.html#start">start</a>() again to restart from the
beginning. To make the timeline loop, you can call <a href="qtimeline.html#loopCount-prop">setLoopCount</a>(), passing the
number of times the timeline should run before finishing. The
direction can also be changed, causing the timeline to run
backward, by calling <a href="qtimeline.html#direction-prop">setDirection</a>(). You can also
pause and unpause the timeline while it's running by calling
<a href="qtimeline.html#setPaused">setPaused</a>(). For interactive
control, the <a href="qtimeline.html#currentTime-prop">setCurrentTime</a>() function is
provided, which sets the time position of the time line directly.
Although most useful in <a href="qtimeline.html#State-enum">NotRunning</a> state, (e.g., connected
to a <a href="qtimeline.html#valueChanged">valueChanged</a>()
signal in a <a href="qslider.html">QSlider</a>,) this function can
be called at any time.</p>
<p>The frame interface is useful for standard widgets, but
QTimeLine can be used to control any type of animation. The heart
of QTimeLine lies in the <a href="qtimeline.html#valueForTime">valueForTime</a>() function, which
generates a <i>value</i> between 0 and 1 for a given time. This
value is typically used to describe the steps of an animation,
where 0 is the first step of an animation, and 1 is the last step.
When running, QTimeLine generates values between 0 and 1 by calling
<a href="qtimeline.html#valueForTime">valueForTime</a>() and
emitting <a href="qtimeline.html#valueChanged">valueChanged</a>().
By default, <a href="qtimeline.html#valueForTime">valueForTime</a>() applies an
interpolation algorithm to generate these value. You can choose
from a set of predefined timeline algorithms by calling <a href="qtimeline.html#curveShape-prop">setCurveShape</a>().</p>
<p>Note that by default, QTimeLine uses the EaseInOut curve shape,
which provides a value that grows slowly, then grows steadily, and
finally grows slowly. For a custom timeline, you can reimplement
<a href="qtimeline.html#valueForTime">valueForTime</a>(), in which
case QTimeLine's <a href="qtimeline.html#curveShape-prop">curveShape</a> property is
ignored.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="CurveShape-enum" />QTimeLine.CurveShape</h3><p>This enum describes the default shape of <a href="qtimeline.html">QTimeLine</a>'s value curve. The default, shape is
EaseInOutCurve. The curve defines the relation between the value
and the timeline.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QTimeLine.EaseInCurve</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The value starts growing slowly, then
increases in speed.</td>
</tr>
<tr>
<td class="topAlign"><tt>QTimeLine.EaseOutCurve</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The value starts growing steadily, then ends
slowly.</td>
</tr>
<tr>
<td class="topAlign"><tt>QTimeLine.EaseInOutCurve</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The value starts growing slowly, then runs
steadily, then grows slowly again.</td>
</tr>
<tr>
<td class="topAlign"><tt>QTimeLine.LinearCurve</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The value grows linearly (e.g., if the
duration is 1000 ms, the value at time 500 ms is 0.5).</td>
</tr>
<tr>
<td class="topAlign"><tt>QTimeLine.SineCurve</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">The value grows sinusoidally.</td>
</tr>
<tr>
<td class="topAlign"><tt>QTimeLine.CosineCurve</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">The value grows cosinusoidally.</td>
</tr>
</table>
<p><b>See also</b> <a href="qtimeline.html#curveShape-prop">setCurveShape</a>().</p>


<h3 class="fn"><a name="Direction-enum" />QTimeLine.Direction</h3><p>This enum describes the direction of the timeline when in
<a href="qtimeline.html#State-enum">Running</a> state.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QTimeLine.Forward</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The current time of the timeline increases
with time (i.e., moves from 0 and towards the end / duration).</td>
</tr>
<tr>
<td class="topAlign"><tt>QTimeLine.Backward</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The current time of the timeline decreases
with time (i.e., moves from the end / duration and towards 0).</td>
</tr>
</table>
<p><b>See also</b> <a href="qtimeline.html#direction-prop">setDirection</a>().</p>


<h3 class="fn"><a name="State-enum" />QTimeLine.State</h3><p>This enum describes the state of the timeline.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QTimeLine.NotRunning</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The timeline is not running. This is the
initial state of <a href="qtimeline.html">QTimeLine</a>, and the
state <a href="qtimeline.html">QTimeLine</a> reenters when
finished. The current time, frame and value remain unchanged until
either <a href="qtimeline.html#currentTime-prop">setCurrentTime</a>() is called,
or the timeline is started by calling <a href="qtimeline.html#start">start</a>().</td>
</tr>
<tr>
<td class="topAlign"><tt>QTimeLine.Paused</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The timeline is paused (i.e., temporarily
suspended). Calling setPaused(false) will resume timeline
activity.</td>
</tr>
<tr>
<td class="topAlign"><tt>QTimeLine.Running</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The timeline is running. While control is in
the event loop, <a href="qtimeline.html">QTimeLine</a> will update
its current time at regular intervals, emitting <a href="qtimeline.html#valueChanged">valueChanged</a>() and <a href="qtimeline.html#frameChanged">frameChanged</a>() when
appropriate.</td>
</tr>
</table>
<p><b>See also</b> <a href="qtimeline.html#state">state</a>() and
<a href="qtimeline.html#stateChanged">stateChanged</a>().</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTimeLine" />QTimeLine.__init__ (<i>self</i>, int&#160;<i>duration</i>&#160;=&#160;1000, <a href="qobject.html">QObject</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a timeline with a duration of <i>duration</i>
milliseconds. <i>parent</i> is passed to <a href="qobject.html">QObject</a>'s constructor. The default duration is
1000 milliseconds.</p>


<h3 class="fn"><a name="currentFrame" />int QTimeLine.currentFrame (<i>self</i>)</h3><p>Returns the frame corresponding to the current time.</p>
<p><b>See also</b> <a href="qtimeline.html#currentTime-prop">currentTime</a>(), <a href="qtimeline.html#frameForTime">frameForTime</a>(), and <a href="qtimeline.html#setFrameRange">setFrameRange</a>().</p>


<h3 class="fn"><a name="currentTime" />int QTimeLine.currentTime (<i>self</i>)</h3><h3 class="fn"><a name="currentValue" />float QTimeLine.currentValue (<i>self</i>)</h3><p>Returns the value corresponding to the current time.</p>
<p><b>See also</b> <a href="qtimeline.html#valueForTime">valueForTime</a>() and <a href="qtimeline.html#currentFrame">currentFrame</a>().</p>


<h3 class="fn"><a name="curveShape" /><a href="qtimeline.html#CurveShape-enum">CurveShape</a> QTimeLine.curveShape (<i>self</i>)</h3><h3 class="fn"><a name="direction" /><a href="qtimeline.html#Direction-enum">Direction</a> QTimeLine.direction (<i>self</i>)</h3><h3 class="fn"><a name="duration" />int QTimeLine.duration (<i>self</i>)</h3><h3 class="fn"><a name="easingCurve" /><a href="qeasingcurve.html">QEasingCurve</a> QTimeLine.easingCurve (<i>self</i>)</h3><h3 class="fn"><a name="endFrame" />int QTimeLine.endFrame (<i>self</i>)</h3><p>Returns the end frame, which is the frame corresponding to the
end of the timeline (i.e., the frame for which the current value is
1).</p>
<p><b>See also</b> <a href="qtimeline.html#setEndFrame">setEndFrame</a>() and <a href="qtimeline.html#setFrameRange">setFrameRange</a>().</p>


<h3 class="fn"><a name="frameForTime" />int QTimeLine.frameForTime (<i>self</i>, int&#160;<i>msec</i>)</h3><p>Returns the frame corresponding to the time <i>msec</i>. This
value is calculated using a linear interpolation of the start and
end frame, based on the value returned by <a href="qtimeline.html#valueForTime">valueForTime</a>().</p>
<p><b>See also</b> <a href="qtimeline.html#valueForTime">valueForTime</a>() and <a href="qtimeline.html#setFrameRange">setFrameRange</a>().</p>


<h3 class="fn"><a name="loopCount" />int QTimeLine.loopCount (<i>self</i>)</h3><h3 class="fn"><a name="resume" />QTimeLine.resume (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void resume()</tt>.</p><p>Resumes the timeline from the current time. <a href="qtimeline.html">QTimeLine</a> will reenter Running state, and once
it enters the event loop, it will update its current time, frame
and value at regular intervals.</p>
<p>In contrast to <a href="qtimeline.html#start">start</a>(), this
function does not restart the timeline before it resumes.</p>
<p><b>See also</b> <a href="qtimeline.html#start">start</a>(),
<a href="qtimeline.html#updateInterval-prop">updateInterval</a>(),
<a href="qtimeline.html#frameChanged">frameChanged</a>(), and
<a href="qtimeline.html#valueChanged">valueChanged</a>().</p>


<h3 class="fn"><a name="setCurrentTime" />QTimeLine.setCurrentTime (<i>self</i>, int&#160;<i>msec</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentTime(int)</tt>.</p><h3 class="fn"><a name="setCurveShape" />QTimeLine.setCurveShape (<i>self</i>, <a href="qtimeline.html#CurveShape-enum">CurveShape</a>&#160;<i>shape</i>)</h3><h3 class="fn"><a name="setDirection" />QTimeLine.setDirection (<i>self</i>, <a href="qtimeline.html#Direction-enum">Direction</a>&#160;<i>direction</i>)</h3><h3 class="fn"><a name="setDuration" />QTimeLine.setDuration (<i>self</i>, int&#160;<i>duration</i>)</h3><h3 class="fn"><a name="setEasingCurve" />QTimeLine.setEasingCurve (<i>self</i>, <a href="qeasingcurve.html">QEasingCurve</a>&#160;<i>curve</i>)</h3><h3 class="fn"><a name="setEndFrame" />QTimeLine.setEndFrame (<i>self</i>, int&#160;<i>frame</i>)</h3><p>Sets the end frame, which is the frame corresponding to the end
of the timeline (i.e., the frame for which the current value is 1),
to <i>frame</i>.</p>
<p><b>See also</b> <a href="qtimeline.html#endFrame">endFrame</a>(), <a href="qtimeline.html#startFrame">startFrame</a>(), and <a href="qtimeline.html#setFrameRange">setFrameRange</a>().</p>


<h3 class="fn"><a name="setFrameRange" />QTimeLine.setFrameRange (<i>self</i>, int&#160;<i>startFrame</i>, int&#160;<i>endFrame</i>)</h3><p>Sets the timeline's frame counter to start at <i>startFrame</i>,
and end and <i>endFrame</i>. For each time value, <a href="qtimeline.html">QTimeLine</a> will find the corresponding frame
when you call <a href="qtimeline.html#currentFrame">currentFrame</a>() or <a href="qtimeline.html#frameForTime">frameForTime</a>() by interpolating,
using the return value of <a href="qtimeline.html#valueForTime">valueForTime</a>().</p>
<p>When in Running state, <a href="qtimeline.html">QTimeLine</a>
also emits the <a href="qtimeline.html#frameChanged">frameChanged</a>() signal when the
frame changes.</p>
<p><b>See also</b> <a href="qtimeline.html#startFrame">startFrame</a>(), <a href="qtimeline.html#endFrame">endFrame</a>(), <a href="qtimeline.html#start">start</a>(), and <a href="qtimeline.html#currentFrame">currentFrame</a>().</p>


<h3 class="fn"><a name="setLoopCount" />QTimeLine.setLoopCount (<i>self</i>, int&#160;<i>count</i>)</h3><h3 class="fn"><a name="setPaused" />QTimeLine.setPaused (<i>self</i>, bool&#160;<i>paused</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setPaused(bool)</tt>.</p><p>If <i>paused</i> is true, the timeline is paused, causing
<a href="qtimeline.html">QTimeLine</a> to enter Paused state. No
updates will be signaled until either <a href="qtimeline.html#start">start</a>() or setPaused(false) is called.
If <i>paused</i> is false, the timeline is resumed and continues
where it left.</p>
<p><b>See also</b> <a href="qtimeline.html#state">state</a>() and
<a href="qtimeline.html#start">start</a>().</p>


<h3 class="fn"><a name="setStartFrame" />QTimeLine.setStartFrame (<i>self</i>, int&#160;<i>frame</i>)</h3><p>Sets the start frame, which is the frame corresponding to the
start of the timeline (i.e., the frame for which the current value
is 0), to <i>frame</i>.</p>
<p><b>See also</b> <a href="qtimeline.html#startFrame">startFrame</a>(), <a href="qtimeline.html#endFrame">endFrame</a>(), and <a href="qtimeline.html#setFrameRange">setFrameRange</a>().</p>


<h3 class="fn"><a name="setUpdateInterval" />QTimeLine.setUpdateInterval (<i>self</i>, int&#160;<i>interval</i>)</h3><h3 class="fn"><a name="start" />QTimeLine.start (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void start()</tt>.</p><p>Starts the timeline. <a href="qtimeline.html">QTimeLine</a> will
enter Running state, and once it enters the event loop, it will
update its current time, frame and value at regular intervals. The
default interval is 40 ms (i.e., 25 times per second). You can
change the update interval by calling <a href="qtimeline.html#updateInterval-prop">setUpdateInterval</a>().</p>
<p>The timeline will start from position 0, or the end if going
backward. If you want to resume a stopped timeline without
restarting, you can call <a href="qtimeline.html#resume">resume</a>() instead.</p>
<p><b>See also</b> <a href="qtimeline.html#resume">resume</a>(),
<a href="qtimeline.html#updateInterval-prop">updateInterval</a>(),
<a href="qtimeline.html#frameChanged">frameChanged</a>(), and
<a href="qtimeline.html#valueChanged">valueChanged</a>().</p>


<h3 class="fn"><a name="startFrame" />int QTimeLine.startFrame (<i>self</i>)</h3><p>Returns the start frame, which is the frame corresponding to the
start of the timeline (i.e., the frame for which the current value
is 0).</p>
<p><b>See also</b> <a href="qtimeline.html#setStartFrame">setStartFrame</a>() and <a href="qtimeline.html#setFrameRange">setFrameRange</a>().</p>


<h3 class="fn"><a name="state" /><a href="qtimeline.html#State-enum">State</a> QTimeLine.state (<i>self</i>)</h3><p>Returns the state of the timeline.</p>
<p><b>See also</b> <a href="qtimeline.html#start">start</a>(),
<a href="qtimeline.html#setPaused">setPaused</a>(), and <a href="qtimeline.html#stop">stop</a>().</p>


<h3 class="fn"><a name="stop" />QTimeLine.stop (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void stop()</tt>.</p><p>Stops the timeline, causing <a href="qtimeline.html">QTimeLine</a> to enter <a href="qtimeline.html#State-enum">NotRunning</a> state.</p>
<p><b>See also</b> <a href="qtimeline.html#start">start</a>().</p>


<h3 class="fn"><a name="timerEvent" />QTimeLine.timerEvent (<i>self</i>, <a href="qtimerevent.html">QTimerEvent</a>&#160;<i>event</i>)</h3><p>Reimplemented from <a href="qobject.html#timerEvent">QObject.timerEvent</a>().</p>


<h3 class="fn"><a name="toggleDirection" />QTimeLine.toggleDirection (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void toggleDirection()</tt>.</p><p>Toggles the direction of the timeline. If the direction was
Forward, it becomes Backward, and vice verca.</p>
<p><b>See also</b> <a href="qtimeline.html#direction-prop">setDirection</a>().</p>


<h3 class="fn"><a name="updateInterval" />int QTimeLine.updateInterval (<i>self</i>)</h3><h3 class="fn"><a name="valueForTime" />float QTimeLine.valueForTime (<i>self</i>, int&#160;<i>msec</i>)</h3><p>Returns the timeline value for the time <i>msec</i>. The
returned value, which varies depending on the curve shape, is
always between 0 and 1. If <i>msec</i> is 0, the default
implementation always returns 0.</p>
<p>Reimplement this function to provide a custom curve shape for
your timeline.</p>
<p><b>See also</b> <a href="qtimeline.html#CurveShape-enum">CurveShape</a> and <a href="qtimeline.html#frameForTime">frameForTime</a>().</p>
<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="finished" />void finished ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when <a href="qtimeline.html">QTimeLine</a> finishes (i.e., reaches the end of
its time line), and does not loop.</p>


<h3 class="fn"><a name="frameChanged" />void frameChanged (int)</h3><p>This is the default overload of this signal.</p><p><a href="qtimeline.html">QTimeLine</a> emits this signal at
regular intervals when in <a href="qtimeline.html#State-enum">Running</a> state, but only if the
current frame changes. <i>frame</i> is the current frame
number.</p>
<p><b>See also</b> <a href="qtimeline.html#setFrameRange">QTimeLine.setFrameRange</a>() and
<a href="qtimeline.html#updateInterval-prop">QTimeLine.updateInterval</a>.</p>


<h3 class="fn"><a name="stateChanged" />void stateChanged (QTimeLine::State)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever <a href="qtimeline.html">QTimeLine</a>'s state changes. The new state is
<i>newState</i>.</p>


<h3 class="fn"><a name="valueChanged" />void valueChanged (qreal)</h3><p>This is the default overload of this signal.</p><p><a href="qtimeline.html">QTimeLine</a> emits this signal at
regular intervals when in <a href="qtimeline.html#State-enum">Running</a> state, but only if the
current value changes. <i>value</i> is the current value.
<i>value</i> is a number between 0.0 and 1.0</p>
<p><b>See also</b> <a href="qtimeline.html#duration-prop">QTimeLine.setDuration</a>(),
<a href="qtimeline.html#valueForTime">QTimeLine.valueForTime</a>(), and
<a href="qtimeline.html#updateInterval-prop">QTimeLine.updateInterval</a>.</p>


<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>